<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap.css">
<html>
<head>
    <meta charset="utf-8">
    <title>Title</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        html {
            height: 100%;
        }

        body {
            background: url(https://img.51miz.com/Element/00/59/33/44/6766b1bb_E593344_6baa5e03.jpg) no-repeat center center;
            height: 100%;
            width: 100%;
            background-size: cover;
            position: absolute;
            left: 0;
            top: 0
        }
    </style>
</head>
<body>
<div class="container">
    <center>
        <h3>欢迎使用成绩管理系统</h3>
    </center>
    <div>
        <div style="width: 50%;text-align: center;margin: 0 auto">
            <h4>管理员操作</h4>
            <input type="button" onclick="f1()" value="添加教师" class="btn btn-primary">
            <input type="button" onclick="f2()" value="查看教师" class="btn btn-primary">
            <input type="button" onclick="f3()" value="添加学生" class="btn btn-primary">
            <input type="button" onclick="f4()" value="查看学生" class="btn btn-primary">
            <input type="button" onclick="f5()" value="添加院系" class="btn btn-primary">
            <input type="button" onclick="f6()" value="查看院系" class="btn btn-primary">
            <input type="button" onclick="f7()" value="添加课程" class="btn btn-primary">
            <input type="button" onclick="f8()" value="查看课程" class="btn btn-primary">
            <input type="button" onclick="f9()" value="绑定教师学生关系" class="btn btn-primary">
        </div>
        <div style="float: left">
            <h4>教师操作</h4>
            <input type="button" onclick="f10()" value="教师管理学生成绩" class="btn btn-primary">
            <input type="button" onclick="f11()" value="查看个人信息" class="btn btn-primary">
        </div>
        <div style="float: right">
            <h4>学生操作</h4>
            <input type="button" onclick="f12()" value="学生查看个人成绩" class="btn btn-primary">
            <input type="button" onclick="f13()" value="查看个人信息" class="btn btn-primary">
        </div>
    </div>

</div>
</body>
</html>
<script>
    function gly(){
        var rtv = '';
        var myajax = $.ajax({
            url: "/gly",
            type: "post",
            async: false,
            cache: false,
            dataType: "text",
            "success": function (json) {
                rtv = json
            }
        })
        $.when(myajax).done(function () {
        });
        return rtv
    }
    function js(){
        var rtv = '';
        var myajax = $.ajax({
            url: "/js",
            type: "post",
            async: false,
            cache: false,
            dataType: "text",
            "success": function (json) {
                rtv = json
            }
        })
        $.when(myajax).done(function () {
        });
        return rtv
    }
    function xs(){
        var rtv = '';
        var myajax = $.ajax({
            url: "/xs",
            type: "post",
            async: false,
            cache: false,
            dataType: "text",
            "success": function (json) {
                rtv = json
            }
        })
        $.when(myajax).done(function () {
        });
        return rtv
    }

    function f1() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "addJiaoshi.html";
        }
    }

    function f2() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "findAllJiaoshi.html";
        }
    }

    function f3() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "addXuesheng.html";
        }
    }

    function f4() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "findAllXuesheng.html";
        }
    }

    function f5() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "addYuanxi.html";
        }
    }

    function f6() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "findAllYuanxi.html";
        }
    }

    function f7() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "addKecheng.html";
        }
    }

    function f8() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "findAllKecheng.html";
        }
    }

    function f9() {
        var rtv = gly()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "jiaoshiXuesheng.html";
        }
    }

    function f10() {
        var rtv = js()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "chengji.html";
        }
    }

    function f11() {
        var rtv = js()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "showXinxi.html";
        }
    }


    function f12() {
        var rtv = xs()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "showChengji.html";
        }
    }
    function f13() {
        var rtv = xs()
        if(rtv!='11'){
            alert(rtv)
        }else{
            window.location.href = "showXinxi.html";
        }
    }

</script>